<?php
class NavView{
	public static $getPageKey = 'page';
	
	//Returnerar huruvida reg är satt
	public function GetPage(){
		if(isset($_GET[self::$getPageKey])){
			return $_GET[self::$getPageKey];
		}
		return null;
	}
	/**
	 * Skapar html meny baserat på inloggningsstatus 
	 *
	 * @return string HTML
	 */
	public function DoNavigationBox($isLoggedIn = false){
		if($isLoggedIn){
			return "<div id='menu'>
						<div id='menu-arrow'></div>
						<div id='menu-text'>
							<a href='?".self::$getPageKey."=".Action::SHOW_NEWS."'>Home</a>
							<a href='?".self::$getPageKey."=".Action::ARTICLE_WRITE."'>Write Article</a>
							<a href='?".self::$getPageKey."=".Action::ARTICLE_LIST."'>Edit Articles</a>
						</div>	
						<div class='clear'></div>		
					</div>";			
		}
		return "<div id='menu'>
					<div id='menu-arrow'></div>
					<div id='menu-text'>
						<a href='?".self::$getPageKey."=".Action::SHOW_NEWS."'>Home</a>
						<a href='?".self::$getPageKey."=".Action::USER_REGISTER."'>Create an account</a>
					</div>	
					<div class='clear'></div>		
				</div>";
	}
}
?>